import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { AnalysisComponent } from './analysis.component';
import { SharedModule } from '@shared/shared.module';
import { RouterModule, Routes } from '@angular/router';
import { CensusComponent } from './census/census.component';
import { ClassDrillComponent } from './class-drill/class-drill.component';
import { AfterDrillComponent } from './after-drill/after-drill.component';
import { StudentDrillComponent } from './student-drill/student-drill.component';
import { DrillContainerComponent } from './drill-container/drill-container.component';
import { AdvanceComponent } from './advance/advance.component';

const routes: Routes = [
    {
        path: '', component: AnalysisComponent,
        children: [
            { path: '', redirectTo: './census' },
            { path: 'census', component: CensusComponent },
            {
                path: 'drillContainer', component: DrillContainerComponent,
                children: [
                    { path: 'classDrill', component: ClassDrillComponent },
                    { path: 'studentDrill/:id', component: StudentDrillComponent },
                    { path: 'advance', component: AdvanceComponent }

                ]
            },
            { path: 'afterDrill', component: AfterDrillComponent },
        ],
    }
];

@NgModule({
  imports: [
      SharedModule,
      RouterModule.forChild(routes)
  ],
  declarations: [AnalysisComponent, CensusComponent, ClassDrillComponent, AfterDrillComponent, StudentDrillComponent, DrillContainerComponent, AdvanceComponent]
})
export class AnalysisModule { }
